#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/hash_policy.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define ps putchar(' ')
#define pe putchar('\n')
#define int long long
#define eb emplace_back
#define pi pair<int, int>
#define mk make_pair
#define fi first
#define se second
#define Ad tr[p].ad
// #define Ad t[p].ad
#define ls p << 1
#define rs p << 1 | 1
// #define ls tr[p].son[0]
// #define rs tr[p].son[1]
// #define ls t[p].son[0]
// #define rs t[p].son[1]
#define len (r - l + 1)
#define mid ((l + r) >> 1)
using namespace std;
// using namespace __gnu_pbds
inline int read()
{
    int f = 0, ans = 0;
    char c = getchar();
    while (!isdigit(c))
        f |= c == '-', c = getchar();
    while (isdigit(c))
        ans = (ans << 3) + (ans << 1) + c - 48, c = getchar();
    return f ? -ans : ans;
}
void write(int x)
{
    if (x < 0)
        putchar('-'), x = -x;
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
const int N = 2e5 + 5, M = N << 2, inf = 1e18, mod = 998244353;

signed main()
{
    freopen("tree.in", "r", stdin);
    freopen("tree.out", "w", stdout);
	int T=read();
	while(T--) {
		int x=read();
		if(x==0) { puts("2"); continue; }
		if(x<=1e3) {
			for(int n=1;n<=100;++n) {
				auto check=[&]() {
					for(int i=n+1>>1;i;--i)
						for(int j=n+1>>1;j>i;--j)
							if(((i*(i-1)+(1+n-i)*(n-i))/2)-((j*(j-1)+(1+n-j)*(n-j))/2)==x)
								return 1;
					return 0;
				};
				if(check()) { write(n), pe; break; }
			}
			continue;
		}
		auto odd=[&]() {
			int n=sqrt(4.0*x)+1;
			for(int i=max(n-10, 1ll);i<=n+10;++i)
				if(i&1)	assert((i-1)*(i-1)%4==0);
			for(int i=max(n-10, 1ll);i<=n+10;++i)
				if(i&1 && (i-1)*(i-1)%4==0 && (i-1)*(i-1)/4==x) {
					write(i), pe;
					return 1;
				}
			return 0;
		};
		auto even=[&]() {
			int n=sqrt(4.0*x);
			for(int i=max(n-10, 1ll);i<=n+10;++i)
				if(i&1^1)	assert(i*(i-2)%4==0);
			for(int i=max(n-10, 1ll);i<=n+10;++i)
				if(i&1^1 && i*(i-2)/4==x) {
					write(i), pe;
					return 1;
				}
			return 0;
		};
		if(!odd())	even();
	}
    return 0;
}
